package com.pingan.haofang.searchcloud.common.support;

import com.pingan.haofang.searchcloud.common.dto.PageQueryDTO;
import org.springframework.data.domain.PageRequest;

/**
 * 分页相关工具类
 *
 * @author baojie371
 * @date 17/5/3
 * @since 1.0.0
 */
public final class PageSupport {

    private PageSupport() {
        throw new UnsupportedOperationException("UnsupportedOperation");
    }

    public static PageRequest pageQuery2PageRequest(PageQueryDTO pageQueryDTO) {
        return new PageRequest(pageQueryDTO.getPageNo() - 1, pageQueryDTO.getPageSize());
    }
}
